package com.yangxk.kadmin.common.support.generator;

/**
 * 有序ID生成器
 *
 * @author yangxk
 * @date 2018/9/12 18:07
 */
public class IdGenerator {

    /**
     * 主机和进程的机器码
     */
    private static final Sequence worker = new Sequence();

    public static long getId() {
        return worker.nextId();
    }

    public static String getIdStr() {
        return String.valueOf(worker.nextId());
    }

    public static void main(String[] args) {
        System.out.println(getId());
    }
}
